#include <stdio.h>

int main()
{
  int num;

  printf("输入一个数字 : ");
  scanf("%d", &num);

  // ? : 运算符(三元运算符)
  (num % 2 == 0) ? printf("偶数") : printf("奇数");

  /* 使用 if 语句检查布尔条件 */

  if (num > 10)
  {
    printf("\n 输入的数字大于10 \n");
  } else {
    printf("\n 输入的数字小于10 \n");
  }

  // switch
  int a;
  printf("input integer number: ");
  scanf("%d", &a);
  switch (a)
  {
  case 1:
    printf("Monday\n");
    break;
  case 2:
    printf("Tuesday\n");
    break;
  case 3:
    printf("Wednesday\n");
    break;
  case 4:
    printf("Thursday\n");
    break;
  case 5:
    printf("Friday\n");
    break;
  case 6:
    printf("Saturday\n");
    break;
  case 7:
    printf("Sunday\n");
    break;
  default:
    printf("error\n");
  }
}

// gcc -o main_if.cpp main_if.c && ./main_if.cpp